/*
 * @Author: your name
 * @Date: 2021-01-26 11:07:26
 * @LastEditTime: 2021-01-28 18:31:20
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \tlwok-front-purchase-platfrom\src\api\purchase\goods.js
 */
import Http from '@/lib/http';

export function importParsing (file) {
  const fd = new FormData();
  fd.append('file', file);
  return Http.post('/purchase/goods/importParsing', fd);
}

export function uploadGoodsImage (file) {
  const fd = new FormData();
  fd.append('file', file);
  return Http.post('/purchase/goods/upload', fd);
}

export function itemQuery (data) {
  return Http.get('/purchase/goods/itemQuery', { ...data });
}

export function batchImport (file) {
  const fd = new FormData();
  fd.append('file', file);
  return Http.post('/purchase/goods/batchImport', fd);
}

export function add (data) {
  return Http.post('/purchase/goods/add',{...data});
}

export function update (data) {
  return Http.post('/purchase/goods/update',{...data});
}

export function pageList (data) {
  return Http.get('/purchase/goods/pageList', {
    ...data,
  });
}

export function batchDelete (data) {
  return Http.post('/purchase/goods/batchDelete', {
    ...data,
  });
}

export function deleteGoods (id) {
  return Http.post(`/purchase/goods/delete/${id}`);
}
